package top.songxs.gmall.feign.search;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import top.songxs.gmall.common.result.Result;
import top.songxs.gmall.feign.search.fallback.GoodsFeignClientFallBack;
import top.songxs.gmall.search.dto.SearchParamDTO;
import top.songxs.gmall.search.entity.Goods;
import top.songxs.gmall.search.vo.SearchResponseVo;

@FeignClient(value = "service-search",fallback = GoodsFeignClientFallBack.class)
public interface GoodsFeignClient {


    @PostMapping("api/inner/search/saveGoods")
    public Result saveGoods(@RequestBody Goods goods);


    @GetMapping("api/inner/search/deleteGoods/{skuId}")
    public Result deleteGoods(@PathVariable("skuId") Long skuId);

    @PostMapping(value = "api/inner/search/searchGoods")
    public Result<SearchResponseVo> search(@RequestBody SearchParamDTO searchParamDTO) ;

    @PutMapping("api/inner/search/updateHotScore")
    public Result updateHotScore(@RequestParam("goodsId") Long goodsId , @RequestParam("hotScore")Integer hotScore) ;


}
